package Throwable;

import org.junit.Test;

import java.io.*;

public class IoTest {
    @Test
    public void test(){
        try(
             BufferedInputStream bis=new BufferedInputStream(new FileInputStream(new File("./IO_File/hello.txt")));
            BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(new File("out.txt")))
           ){
           int len;
           byte[] bytes=new byte[20];
           while ((len=bis.read(bytes))!=-1){
               bos.write(bytes,0,len);
           }

        }catch (Exception e){
                e.printStackTrace();
        }
    }
}
